package com.hmall.common.dto.client;



import com.hmall.common.dto.PageDTO;
import com.hmall.common.dto.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "itemservice")
public interface ItemClient {
    @RequestMapping(value="/item/list",method = RequestMethod.GET)
    PageDTO<Item> list(@RequestParam(defaultValue = "1") Integer page ,
                       @RequestParam(defaultValue = "5") Integer size);

    @GetMapping("/item/{id}")
    Item getById(@PathVariable Long id);

    @PutMapping("/item/stock/{itemId}/{num}")
     void reduceStock(@PathVariable Long itemId,
                     @PathVariable Integer num);
}
